<?php
class M_QQ
{ 
  static public function get_user_info($openid, $openkey, $pf=DEFAULT_QQ_PF)
  {
    $params = array(
		    'openid' => $openid,
		    'openkey' => $openkey,
		    'pf' => $pf,
		    );
	
    $script_name = '/v3/user/get_info';

    $sdk = new M_OpenApiV3(APP_ID, APP_KEY);
    $sdk->setServerName(API_SERVER);
    return $sdk->api($script_name, $params);
  }

  static public function is_login($openid, $openkey, $pf=DEFAULT_QQ_PF)
  {
    $params = array(
		    'openid' => $openid,
		    'openkey' => $openkey,
		    'pf' => $pf,
		    );
	
    $script_name = '/v3/user/is_login';

    $sdk = new M_OpenApiV3(APP_ID, APP_KEY);
    $sdk->setServerName(API_SERVER);
    return $sdk->api($script_name, $params);
  }

  static public function word_filter($openid, $openkey, 
				     $content, $msgid, $pf=DEFAULT_QQ_PF)
  {
    $params = array(
		    'openid' => $openid,
		    'openkey' => $openkey,
		    'content' => $content,
		    'msgid' => $msgid,
		    'pf' => $pf,
		    );
    $script_name = "/v3/csec/word_filter";
    $sdk = new M_OpenApiV3(APP_ID, APP_KEY);
    $sdk->setServerName(API_SERVER);
    return $sdk->api($script_name, $params);
  }
}
